package com.unchartedskies.view
{
	import com.gamesmile.framework.util.Log;
	import com.unchartedskies.controller.event.CreditsClickEvent;
	
	import flash.events.MouseEvent;
	
	import org.robotlegs.mvcs.Mediator;
	
	public class CreditsMediator extends Mediator
	{
		[Inject]
		public var view:Credits;
		
		public function CreditsMediator()
		{
			super();
		}
		override public function onRegister():void
		{
			Log.debug(this,"Register");
			eventMap.mapListener(view, MouseEvent.CLICK, onClick);
		}
		protected function onClick(e:MouseEvent):void
		{
			Log.debug(this,"Click : "+e.target.name);
			var targetName:String = e.target.name;
			
			dispatch(new CreditsClickEvent(CreditsClickEvent.CREDITS_CLICKED, targetName));
		}
	}
}